package com.greedy.order.controller;

import com.greedy.order.pojo.Order;
import com.greedy.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Greedy
 * @Date: Created in:2022-07-19 15:19
 * Description:
 */
@RestController
@RequestMapping("order/")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     * 根据Id查询订单表所有数据
     * @param orderId
     * @return
     */
    @GetMapping("{orderId}")
    public Order getOrderById(@PathVariable("orderId") Long orderId) {
        return orderService.getOrderById(orderId);
    }
}
